﻿using System;

namespace PGMapper
{
    [AttributeUsage(AttributeTargets.Class)]
    public class TableAttribute : Attribute
    {
        public string Name { get; private set; }

        public TableAttribute(string name)
        {
            this.Name = name;
        }

        public static TableAttribute Find(Type t)
        {
            object[] atts = t.GetCustomAttributes(typeof(TableAttribute), false);
            return atts.Length > 0 ? (TableAttribute)atts[0] : null;
        }
    }
}
